import { AxiosPromise } from 'axios'
// import { RoleQuery, RolePageResult, RoleForm } from './types'
import service from '@/utils/request'
const { resourceService } = service;
import { Task } from "./type";
/**
 * 
 *获取定时器任务
 * 
 */
export function getScheduledTasks() : any {
	return resourceService({
	  url: '/resource/scheduled/taskList',
	  method: 'get'
	});
}

export function Restart(taskKey:string) : any {
	return resourceService({
	  url: `/resource/scheduled/restart/${taskKey}`,
	  method: 'get'
	});
}

export function Start(taskKey:string) : any {
	return resourceService({
	  url: `/resource/scheduled/start/${taskKey}`,
	  method: 'get'
	});
}

export function Stop(taskKey:string) : any {
	return resourceService({
	  url: `/resource/scheduled/stop/${taskKey}`,
	  method: 'get'
	});
}

export function Update(task : Task) : any {
	return resourceService({
	  url: `/resource/scheduled/update`,
	  data: task,
	  method: 'put'
	});
}
